<template>
	<view v-if="state==2" :class="boxClass">
		<slot />
	</view>
	<view v-else-if="state==1" class="fjc" :style="{height: height+'vh'}">
		<Loading />
	</view>
</template>

<script>
export default {
	props: {
		text: {
			type: String,
			default: '暂无内容哦~'
		},
		icon: {
			type: String,
			default: 'data'
		},
		height: {
			type: [String, Number],
			default: 90
		},
		boxClass: {
			type: String,
			default: ''
		}
	},
	computed: {
		state() {
			if(this.$props.state){
				return this.$props.state
			}
			// #ifdef H5
			return this.$parent.$parent.loadstate
			// #endif
			// #ifndef H5
			return this.$parent.loadstate
			// #endif
		},
		view() {
			if(this.$props.view){
				return this.$props.view
			}
			// #ifdef H5
			return this.$parent.$parent.view
			// #endif
			// #ifndef H5
			return this.$parent.view
			// #endif
		}
	}
}
</script>